import Vue from 'vue'
import VueRouter from 'vue-router'
// import '../views'

Vue.use(VueRouter)
// const _import_ = file = > () = > import('../views/' + file + '.vue');
// console.log('_import_',_import_)

// 测试配置路由模式

const routes = [{
    path: '/login',
    name: 'Login',
    meta: {
      isAuthenticated: true, // 添加该字段，表示进入这个路由是需要登录的
    },
    component: () => import( /* webpackChunkName: "about" */ '../views/login/index.vue'),
  },
  {
    path: '/',
    redirect: '/home/index',
    name: '首页',
    component: () => import( /* webpackChunkName: "about" */ '../views/home/home.vue'),
    children: [{
        path: '/home/index', //首页
        name: "首页",
        component: () => import('../views/home/index.vue'),
      },
      {
        path: '/home/use', //用户列表
        name: "用户列表",
        component: () => import('../views/user/userlist.vue'),
      },
      {
        path: '/home/lookuser', //查看用户列表
        component: () => import('../views/user/lookuser.vue'),
      },
      {
        path: '/home/merchant', //商户列表
        component: () => import('../views/merchant/index.vue'),
      },
      {
        path: '/home/lookmerchant', //商户列表
        component: () => import('../views/merchant/lookmerchant.vue'),
      },
      {
        path: '/home/order', //充值列表
        component: () => import('../views/order/index.vue'),
      },
      {
        path: '/home/gold', //金币列表
        component: () => import('../views/order/gold.vue'),
      },
      {
        path: '/home/petgold', //宠物金币列表
        component: () => import('../views/order/petgold.vue'),
      },
      {
        path: '/home/grain', //粮食列表
        component: () => import('../views/order/grain.vue'),
      },
      {
        path: '/home/commodity', //商品列表
        component: () => import('../views/commodity/index.vue'),
      },
      {
        path: '/home/check', //审核管理
        component: () => import('../views/check/index.vue'),
      },
      {
        path: '/home/lookcheck', //查看商家
        component: () => import('../views/check/lookcheck.vue'),
      },
      {
        path: '/home/withdraw', //审核管理
        component: () => import('../views/check/withdraw.vue'),
      },
      {
        path: '/home/discuss', //用户评论
        component: () => import('../views/content/discuss.vue'),
      },
      {
        path: '/home/merchantList', //商户动态
        component: () => import('../views/content/merchantList.vue'),
      },
      {
        path: '/home/complain', //投诉管理
        component: () => import('../views/content/complain.vue'),
      },
      {
        path: '/home/inform', //举报管理
        component: () => import('../views/content/inform.vue'),
      },
      {
        path: '/home/leave', //留言管理
        component: () => import('../views/content/leave.vue'),
      },
      {
        path: '/home/lookrevert', //回复留言查看
        component: () => import('../views/content/lookrevert.vue'),
      },
      {
        path: '/home/newTask', //新手任务
        component: () => import('../views/marketing/newTask.vue'),
      },
      {
        path: '/home/everydayTask', //每日任务
        component: () => import('../views/marketing/everydayTask.vue'),
      },
      {
        path: '/home/topicality', //话题管理
        component: () => import('../views/marketing/topicality.vue'),
      },
      {
        path: '/home/gambit', //话题分类
        component: () => import('../views/marketing/gambit.vue'),
      },
      {
        path: '/home/banner', //banner管理
        component: () => import('../views/marketing/banner.vue'),
      },
      {
        path: '/home/updateBanner', //上传banner轮播图
        component: () => import('../views/marketing/updateBanner.vue'),
      },
      {
        path: '/home/message', //消息推送
        component: () => import('../views/message/message.vue'),
      },
      {
        path: '/home/addMessage', //新建消息推送
        component: () => import('../views/message/addMessage.vue'),
      },
      {
        path: '/home/versions', //版本管理
        component: () => import('../views/system/versions.vue'),
      },
      {
        path: '/home/addversions', //新增版本管理
        component: () => import('../views/system/addversions.vue'),
      },
      {
        path: '/home/role', //角色管理
        component: () => import('../views/system/role.vue'),
      },
      {
        path: '/home/newrole', //角色管理
        component: () => import('../views/system/newrole.vue'),
      },
      {
        path: '/home/authority', //管理员管理
        component: () => import('../views/system/authority.vue'),
      },
      {
        path: '/home/newadmin', //新建管理员
        component: () => import('../views/system/newadmin.vue'),
      },
      {
        path: '/home/menulist', //菜单管理
        component: () => import('../views/system/menulist.vue'),
      },
      {
        path: '/home/deploy', //配置协议
        component: () => import('../views/system/deploy.vue'),
      },
      {
        path: '/home/addprotocol', //新建配置协议
        component: () => import('../views/system/addprotocol.vue'),
      },
      {
        path: '/home/addmenulist', //新增菜单管理
        component: () => import('../views/system/addmenulist.vue'),
      },
        ////分割
      {
        path: '/home/helperlist', //帮手列表-----ttthhhao新增
        component: () => import('../views/addMenuList/helperlist/helperlist.vue'),
      },
      {
        path: '/home/lookHelperlist', //帮手列表详情-----ttthhhao新增
        component: () => import('../views/addMenuList/helperlist/look.vue'),
      },
      {
        path: '/home/helperApplicationReview', //帮手申请审核-----ttthhhao新增
        component: () => import('../views/addMenuList/helperApplicationReview/helperApplicationReview.vue'),
      },
      {
        path: '/home/reviewOfDepositReturn', //保证金退还审核-----ttthhhao新增
        component: () => import('../views/addMenuList/reviewOfDepositReturn/reviewOfDepositReturn.vue'),
      },
      //社区管理
      {
        path: '/home/club',  //俱乐部管理-----ttthhhao新增
        component: () => import('../views/addMenuList/communityManagement/club/club.vue'),
      },
      {
        path: '/home/lookClub', //帮手列表详情-----ttthhhao新增
        component: () => import('../views/addMenuList/communityManagement/club/look.vue'),
      },
      {
        path: '/home/mutualAid', //帮帮互助管理-----ttthhhao新增
        component: () => import('../views/addMenuList/communityManagement/mutualAid/mutualAid.vue'),
      },
      {
        path: '/home/questionsAndAnswers', //问答管理-----ttthhhao新增
        component: () => import('../views/addMenuList/communityManagement/questionsAndAnswers/questionsAndAnswers.vue'),
      },
    ]
  },
]

const router = new VueRouter({
  // mode: 'history',
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})
export default router